Framework / Resources / Resource Maker
In This Topic
    Resource Maker
    In This Topic

    The Nevron Resource Maker is a command line tool that creates a C# class with resource refernces and merges all files in a given folder to a single binary file that you should mark as "Embedded resource" in Visual Studio. It expects three arguments separated by a space: the resources root path, the resources XML file, and the LOG file.

    The Nevron Resource Maker is currently only available as a Windows executable command line tool. You can find it in the "Tools\Bin" subfolder of your Nevron Open Vision installation. It is by default:

    "C:\Program Files (x86)\Nevron Software\Nevron Open Vision {VERSION}\Tools\Bin".

     Usage

    You can use the resource maker either at the command line or as a pre-build event for your Visual Studio project.

    Sample Usage at Command Prompt
    Copy Code
    C:\NResourceMaker.exe D:\MyProject\Resources Resources.xml ResourceLog.txt
    
    Sample Usage as a Visual Studio Pre-Build Event
    Copy Code
    $(ProjectDir)NResourceMaker $(ProjectDir)\Resources\ Resources.xml ResourcesLog.txt
    

    The above syntax asumes that NResourceMaker.exe is located in the project's root directory and the project has a sub directory "Resources" where all resources are placed.

     Configuration

    The Nevron Resource Maker lets you configure the process of resource creation through a XML configuration file in the following format:

    Nevron Resource Maker Default Settings
    Copy Code
    <resources>
      <source excludeFilter="*.scc">
        <binary includeFilter="*" />
        <cursors includeFilter="*.cur" />
        <fonts includeFilter="*.ttf" />
        <images includeFilter="*.png;*.jpg;*.jpeg;*.bmp;*.gif;*.wmf;*.emf;*.svg;" />
        <text includeFilter="*.txt;*.xml;*.csv;*.json;*.ini;*.cfg;*.htm;*.html;*.css;*.js" />
      </source>
      <target file="NResources.cs" class="NResources" access="internal" namespace="Nevron.Nov.Examples" />
    </resources>
    

    Element and attribute names are case insensitive and have the following meaning:

    • source (OPTIONAL) - lets you define the files from the source directory to exclude, wildcard characters are supported. You should use semicolon (;) to separate the file filters.
      • binary (OPTIONAL) - specifies the binary files to include
      • cursors (OPTIONAL) - specifies the cursor files to include
      • fonts (OPTIONAL) - specifies the font files to include
      • images (OPTIONAL) - specifies the image files to include
      • text (OPTIONAL) - specifies the text files to include
    • target (REQUIRED) - defines the name of the generated resource file as well as its class name, access modifier and namespace. This file will contain the resource definitions. In its folder will also be created a binary file called "NResourceData.bin", which will contain the actual resource data and which should be manually included in your project and marked as embedded resource when generated for the first time.
    Note that only the target element is required. All other elements are optional and can be omitted. If omitted, they will have the default values shown in the XML document above.

     

    See Also